//! $Id: Exception.h 25 2009-10-15 07:17:24Z skagget77 $
//!
//! @file    Exception.h
//! @author  Johan Andersson <skagget77@gmail.com>
//! @date    Fri Oct 02 20:35 2009
//! @ingroup IoCpp
//!

#if !defined(IOCPP_EXCEPTION_H)
#define IOCPP_EXCEPTION_H

#include <stdexcept>

namespace IoCpp
{
   //!
   //! @author  Johan Andersson <skagget77@gmail.com>
   //! @date    Fri Oct 02 20:35 2009
   //! @ingroup IoCpp
   //!
   //! TypeNotFoundException, thrown when the container cannot find the
   //! requested type.
   //!
   struct TypeNotFoundException : std::runtime_error 
   {
      //!
      //! Creates a new instance of the TypeNotFoundException class.
      //!
      //! @param msg The detailed message.
      //!
      TypeNotFoundException( const std::string& msg )
         : std::runtime_error(msg) {
      }
   };


   //!
   //! @author  Johan Andersson <skagget77@gmail.com>
   //! @date    Fri Oct 02 20:35 2009
   //! @ingroup IoCpp
   //!
   //! ProviderNotFoundException, thrown when the container cannot find
   //! a provider for the requested type.
   //!
   struct ProviderNotFoundException : std::runtime_error 
   {
      //!
      //! Creates a new instance of the ProviderNotFoundException class.
      //!
      //! @param msg The detailed message.
      //!
      ProviderNotFoundException( const std::string& msg ) 
         : std::runtime_error(msg) {
      }
   };


   //!
   //! @author  Johan Andersson <skagget77@gmail.com>
   //! @date    Fri Oct 02 20:35 2009
   //! @ingroup IoCpp
   //!
   //! ProviderOfWrongTypeException, thrown when the provider does not create
   //! instances that matches the requested type.
   //!
   struct ProviderOfWrongTypeException : std::runtime_error 
   {
      //!
      //! Creates a new instance of the ProviderOfWrongTypeException class.
      //!
      //! @param msg The detailed message.
      //!
      ProviderOfWrongTypeException( const std::string& msg ) 
         : std::runtime_error(msg) {
      }
   };
}

#endif   // IOCPP_EXCEPTION_H
